function ais = calc_AIS(actual, L_alpha, U_alpha, alpha)
    % Number of predictions
    Nt = length(actual);

    % Initialize the sum of S_alpha
    S_alpha_sum = 0;

    % Loop over each prediction to calculate S_alpha
    for i = 1:Nt
        pi = actual(i);
        L = L_alpha(i);
        U = U_alpha(i);
        zeta = U - L;

        if pi < L
            S_alpha_i = 2 * alpha * zeta + 4 * (L - pi);
        elseif pi > U
            S_alpha_i = 2 * alpha * zeta + 4 * (pi - U);
        else
            S_alpha_i = 2 * alpha * zeta;
        end

        S_alpha_sum = S_alpha_sum + S_alpha_i;
    end

    % Compute the average interval score (AIS)
    ais = S_alpha_sum / Nt;
end
